<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean" prefix="bean"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<%request.setAttribute("ctx",request.getContextPath()); %>
<html>
<head>
<link href="${ctx}/extend/css/style.css" rel="stylesheet"
	type="text/css" />
<script src="${ctx}/extend/js/jquery/jquery.js" type="text/javascript"></script>
<script src="${ctx}/extend/js/dutil/DUtil.js" type="text/javascript"></script>
<script src="${ctx}/extend/css/css.js" type="text/javascript"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="${ctx}/css/style.css" rel="stylesheet" type="text/css" />
<script src="${ctx}/js/common.js" type="text/javascript"></script>
<s:head theme="xhtml" />
<sx:head parseContent="true" />
<title>invoice query</title>
<script type="text/javascript">
    
    function viewInvoiceChart(chartUrl){
    	window.open("${ctx}/web/invoice/invoiceChart.jsp?chartUrl="+chartUrl, "viewChart",  "width=600,height=400,top=200,left=250,scrollbars=auto");
    }
		
	function change(all){

		var item = document.getElementsByName("orderVO");
			if(all.checked){
				for(var i=0;i<item.length;i++){
					item[i].checked = true;
				}
			}
			else{
				for(var i=0;i<item.length;i++){
					item[i].checked = false;
				}
			}
	}
	function printExcel(){
		document.getElementById('execlFrame').src="${ctx}/admin/exportOrder?orderId=${orderId}&orderPeople=${orderPeople}&beginTimeStr=${beginTimeStr}&endTimeStr=${endTimeStr}";
	}
</script>
</head>
<body class="maintable">
	<div class="dclass_container dclass_container_collapsible">
		<div class="dclass_container_header">
			<div class="dclass_container_title">query invoice</div>
		</div>
		<div class="dclass_container_content">
			<div class="search">
				<form action="" method="get">
					<table>
						<tr>
							<td>ItemID:<input type="text" class="inputsearch"
								name="itemId" value="${itemId}" /> &nbsp;&nbsp;&nbsp; eBay
								Account:<input type="text" class="inputsearch" name="ebayAct"
								value="${ebayAct}" /> &nbsp;&nbsp;&nbsp; Title:<input
								type="text" class="inputsearch" name="titleStr"
								value="${titleStr}" /> &nbsp;&nbsp;&nbsp;<br> invoice
								time:<sx:datetimepicker name="begin_time" label="" value=""
									displayFormat="yy-MM-dd" />&nbsp;至&nbsp; <sx:datetimepicker
									name="end_time" label="" value="" displayFormat="yy-MM-dd" />
								&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <input type="image"
								src="${ctx}/images/btn_search.gif" align="absbottom" /></td>
						</tr>
					</table>
				</form>
			</div>


		</div>
	</div>
	<br style="line-height: 5px;" />


	<div class="dclass_container">
		<div class="dclass_container_header">
			<div class="dclass_container_title">Invoice List</div>
		</div>
		<div class="dclass_container_content">
			<!--内容开始-->
			<div class="actions">
				<input name="viewChar" type="button" class="btn1"
					onclick="viewInvoiceChart('${chartURL}');" value="View Chart" />&nbsp;&nbsp;
				<input name="exportExcel" type="button" class="btn1"
					onclick="printExcel();" value="Export Excel" />&nbsp;
			</div>
			<table class="dclass_data" id="table1" style="display: block">
				<thead>
					<tr>
						<th align="center" width="10%">ItemID</th>
						<th align="center" width="10%">eBay Account</th>
						<th align="center" width="10%">Ref Number</th>
						<th align="center" width="25%">Title</th>
						<th align="center" width="8%">Entry Type</th>
						<th align="center" width="8%">Currency</th>
						<th align="center" width="8%">Value</th>
						<th align="center" width="15%">Time</th>
					</tr>
				</thead>
				<tbody>
					<c:choose>
						<c:when test="${empty invoiceEntries}">
							<tr>
								<td style="background-color: #ffffff" colspan="8">no result</td>
							</tr>
						</c:when>
						<c:otherwise>
							<s:iterator value="invoiceEntries" status="status">
								<tr class="list_td" onMouseOver="this.className='list_td0'"
									onMouseOut="this.className='list_td'"
									onDblClick="doOrderDetail('')"
									title="double click to view detail">


									<td align="center"><s:property
											value="invoiceEntries[#status.index].ItemID" /></td>

									<td align="center"><s:property
											value="invoiceEntries[#status.index].EbayAct" /></td>

									<td align="center"><s:property
											value="invoiceEntries[#status.index].RefNumber" /></td>

									<td align="center"><s:property
											value="invoiceEntries[#status.index].Title" /></td>

									<td align="center"><s:property
											value="invoiceEntries[#status.index].AccountDetailsEntryType" /></td>

									<td align="center"><s:property
											value="invoiceEntries[#status.index].Balance.CurrencyID" /></td>

									<td align="right"><s:property
											value="invoiceEntries[#status.index].Balance.Value" /></td>
									<td align="center"><s:property
											value="invoiceEntries[#status.index].Date.getTime()" /></td>
								</tr>
							</s:iterator>
						</c:otherwise>
					</c:choose>
				</tbody>
			</table>
			<div class="dclass_pager">
				<table width="100%">
					<tr>
						<td width="100%" height="1px" bgcolor="#336699"></td>
					</tr>
					<tr>
						<td width="100%" align="center"><c:choose>
								<c:when test="${empty invoiceEntries}">共 0页  第0页   共0条记录</c:when>
								<c:otherwise>
									<c:import url="/admin/common/page3.jsp"></c:import>
								</c:otherwise>
							</c:choose></td>
					</tr>
				</table>
			</div>
			<iframe name="execlFrame" id="execlFrame" width="0" height="0"></iframe>
			<!--内容结束-->
		</div>
	</div>
</body>
</html>